

from datetime import datetime
from flask import Flask
from flask_cors import CORS

from gevent import pywsgi
from connector.scenarioConnector import scenarioConnector
from controller.scenarioController import scenario_controller
from controller.stockController import stock_controller
from controller.backtestController import backtest_controller
from controller.analyzerController import analyzer_controller

from model.expositor import Expositor
from service.backtestService import BacktestService


app = Flask(__name__)
CORS(app, resources=r'/*')

# # 注册蓝图
app.register_blueprint(scenario_controller)
app.register_blueprint(stock_controller)
app.register_blueprint(backtest_controller)
app.register_blueprint(analyzer_controller)


if __name__ == '__main__':

    server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
    server.serve_forever()
    # BacktestService("66264ab461ab450c97396973",datetime(2023, 3, 1, 0, 0, 0),datetime(2023, 4, 20, 0, 0, 0)).startBacktest()
